import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
import clientRouter from "./modules/client";
import manageRouter from "./modules/manage";
const modules = import.meta.glob("../views/**/**.vue");

const routes: Array<RouteRecordRaw> = [
    {
        path: '/',
        component: () => import(/* webpackChunkName: "client" */ '@/views/index.vue'),
        children: [
            ...clientRouter,
            ...manageRouter
        ]
    },
    {
        path: "/:pathMatch('*')",
        name: "Error404",
        component: () => import(/* webpackChunkName: "common" */ "@/views/common/403.vue"),
    },
    {
        path: "/403",
        name: "Error403",
        component: () => import(/* webpackChunkName: "common" */ "@/views/common/403.vue"),
    },
]

const router = createRouter({
    history: createWebHashHistory(),
    routes
})

export default router